/*********************************************************************
* File: IWaypointNavigation.h
*
* Supports waypoint navigation.
*********************************************************************/
#pragma once

#include "../../game/waypoint.h"
#include "IReactiveWaypointNavigation.h"
using namespace game::waypoints;

namespace agents{namespace interfaces{
	/**
	* \class IWaypointNavigation
	* \brief Supports waypoint navigation.
	*
	* Supports pathfinding based on waypoint graphs. This kind of 
	* navigation assumes the agent knows all the information about
	* the world's waypoints. This contrasts with the agents::interfaces::IReactiveWaypointNavigation
	* interface where agents can only access visible waypoints. 
	* This interface, thus, should not be used by reactive agents. 
	*
	* \author Instituto Superior Tecnico de Lisboa, Portugal
	* \author Technical University of Lisbon, Portugal
	* 
	* \author Agentes Autonomos e Sistemas Multiagente
	* \author Autonomous Agents and Multiagent Systems
	* 
	* \version	1.0
	* \date		2006/2007
	**/
	class IWaypointNavigation: public IReactiveWaypointNavigation
	{
	public:

		/** 
		* \brief Sets the cost function for the A* search algorithm. 
		*
		* Pathfinding uses, first, the A* search algorithm to find a path 
		* between waypoints. If the algorithm fails, the Floyd Warshall 
		* shortest path algorithm is used. 
		* 
		* The cost function receives as arguments: the current waypoint index; 
		* and, the parent waypoint index. 
		*
		* Set to NULL to skip the A* search.
		**/
		virtual void setCostFunction(float (*function)(int, int)) = 0;
		/** 
		* \brief Sets the heuristic function for the A* search algorithm.
		*
		* Pathfinding uses, first, the A* search algorithm to find a path 
		* between waypoints. If the algorithm fails, the Floyd Warshall 
		* shortest path algorithm is used. 
		* Reactive agents \a cannot use this interface as it requires internal state.
		* 
		* The heuristic function receives as arguments: the current waypoint index; 
		* the parent waypoint index; and, the goal waypoint index. 
		* 
		* Set to NULL to skip the A* search.
		**/
		virtual void setHeuristicFunction(float (*function)(int, int, int)) = 0;

		//BUG 01: Move to invisible waypoint in the reactive agent: Start
		/**
		* \brief Moves the agent towards a specific waypoint.
		*
		* \param[in]  waypointIndex  The waypoint index.
		**/
		virtual bool moveToWaypoint(int waypointIndex) = 0;
		//BUG 01: End
		/** 
		* \brief Gets the waypoint array.
		**/
		virtual Waypoint** getWaypoints() = 0;
		/** 
		* \brief Gets the number of waypoints.
		**/
		virtual int getNumberOfWaypoints() = 0;
		/** 
		* \brief Gets the goal waypoint indices.
		**/
		virtual int* getGoalWaypointIndices() = 0;
		/** 
		* \brief Gets the number of goal waypoints.
		**/
		virtual int getNumberOfGoalWaypoints() = 0;
		/** 
		* \brief Gets the terrorist important waypoint indices.
		**/
		virtual int* getTerroristImportantWaypointIndices() = 0;
		/** 
		* \brief Gets the counter-terrorist important waypoint indices.
		**/
		virtual int getNumberOfTerroristImportantWaypoints() = 0;
		/** 
		* \brief Gets the number of counter-terrorist important waypoints.
		**/
		virtual int* getCounterTerroristImportantWaypointIndices() = 0;
		/** 
		* \brief Gets the number of counter-terrorist important waypoints.
		**/
		virtual int getNumberOfCounterTerroristImportantWaypoints() = 0;
		/** 
		* \brief Gets the camp waypoint indices.
		**/
		virtual int* getCampWaypointIndices() = 0;
		/** 
		* \brief Gets the number of camp waypoints.
		**/
		virtual int getNumberOfCampWaypoints() = 0;
	};
}}
